import { GET_CHANNEL_LIST, GET_ARTICLE_LIST } from '../constants/article'

const initState = {
  channels: [],
  articles: {},
}
export default function article(state = initState, action) {
  if (action.type === GET_CHANNEL_LIST) {
    return {
      ...state,
      channels: action.payload
    }
  }
  if (action.type === GET_ARTICLE_LIST) {
    return {
      ...state,
      articles: action.payload
    }
  }
  return state
}